﻿<phone:PhoneApplicationPage
    x:Class="zhangkong.CoursePage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:system="clr-namespace:System;assembly=mscorlib"
    d:DataContext="{d:DesignData SampleData/CoursesData.xaml}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True"
    shell:SystemTray.Opacity="0"
    shell:SystemTray.ForegroundColor="Snow"
    toolkit:TiltEffect.IsTiltEnabled="True"
    >
    <phone:PhoneApplicationPage.FontFamily>
        <StaticResource ResourceKey="PhoneFontFamilyNormal"/>
    </phone:PhoneApplicationPage.FontFamily>
    <phone:PhoneApplicationPage.FontSize>
        <StaticResource ResourceKey="PhoneFontSizeNormal"/>
    </phone:PhoneApplicationPage.FontSize>
    <phone:PhoneApplicationPage.Foreground>
        <StaticResource ResourceKey="PhoneForegroundBrush"/>
    </phone:PhoneApplicationPage.Foreground>
    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardIn"/>
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardIn"/>
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardOut"/>
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardOut"/>
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>


    <phone:PhoneApplicationPage.Resources>
        <system:Double x:Key="FontSize">18</system:Double>
        <Style x:Key="CourseButton" TargetType="Button" x:Name="CourseButtonStyle">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderBrush" Value="{StaticResource PhoneForegroundBrush}"/>
            <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
            <Setter Property="BorderThickness" Value="{StaticResource PhoneBorderThickness}"/>
            <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilySemiBold}"/>
            <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeMedium}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid Background="Transparent">
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver"/>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled">
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border  x:Name="ButtonBackground" BorderThickness="0" CornerRadius="5" Background="{TemplateBinding Background}" Margin="0">
                                <TextBlock x:Name="ContentContainer" FontSize="15.5" TextAlignment="Center" TextWrapping="Wrap" Text="{TemplateBinding Content}" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>
                                <!--<ContentControl x:Name="ContentContainer" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>-->
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <!--<DataTemplate x:Key="MyCourse">
            <Grid Background="{Binding TeacherName, Converter={StaticResource TToC}}" Opacity="{Binding CourseName, Converter={StaticResource CToO}}" Height="{Binding Length, Converter={StaticResource LToH}}" Margin="1,1,1,1">
                <TextBlock Text="{Binding Detail}" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White" TextAlignment="Center" TextWrapping="Wrap"/>
                <Button Opacity="0" Click="Ceshi_Click"></Button>
            </Grid>
        </DataTemplate>-->
    </phone:PhoneApplicationPage.Resources>



    <!--LayoutRoot 是包含所有页面内容的根网格-->
    <Grid x:Name="LayoutRoot">

        <ProgressBar x:Name="ProgressBar" Foreground="White" Visibility="Collapsed" IsIndeterminate="True"></ProgressBar>
        
        
        <Grid Height="70" VerticalAlignment="Top">
            <TextBlock FontSize="50" TextAlignment="Left" Margin="12,6,0,0" Text="课表" Foreground="#C8FFFFFF" FontFamily="Microsoft YaHei Light"/>
            <Grid Height="70" Width="100">
                <TextBlock x:Name="WeekNumberTextBlock" IsHitTestVisible="False" Foreground="#C8FFFFFF" TextAlignment="Center" FontSize="30" Width="100" FontFamily="Microsoft YaHei Light" Margin="0,20,0,0"/>
                <TextBlock x:Name="CurrentWeekTextBlock" Text="本周" Foreground="#C8FFFFFF" TextAlignment="Center" Margin="105,29,-50,13"></TextBlock>
            </Grid>
        </Grid>

        <Grid Margin="0,70,0,0" x:Name="DateGrid">

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="50"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="50"/>
                <RowDefinition Height="64.28"/>
                <RowDefinition Height="64.28"/>
                <RowDefinition Height="64.28"/>
                <RowDefinition Height="64.28"/>
                <RowDefinition Height="64.28"/>
                <RowDefinition Height="64.28"/>
                <RowDefinition Height="64.28"/>
                <RowDefinition Height="64.28"/>
                <RowDefinition Height="64.28"/>
                <RowDefinition Height="64.28"/>
                <RowDefinition Height="64.28"/>
            </Grid.RowDefinitions>


            <TextBlock x:Name="MonthTextBlock" TextAlignment="Center" Grid.Column="0" Grid.Row="0" FontSize="19" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,-1,0,0" Foreground="White" FontFamily="Arial">
            </TextBlock>

            <TextBlock x:Name="MondayTextBlock" Grid.Column="1" Grid.Row="0" FontSize="19" HorizontalAlignment="Center" TextAlignment="Center" Foreground="White" Opacity="1" FontFamily="Arial">
            </TextBlock>
            <TextBlock x:Name="TuesdayTextBlock" Grid.Column="2" Grid.Row="0" FontSize="19" HorizontalAlignment="Center" TextAlignment="Center" Foreground="White" Opacity="1" FontFamily="Arial">
            </TextBlock>
            <TextBlock x:Name="WednesdayTextBlock" Grid.Column="3" Grid.Row="0" FontSize="19" HorizontalAlignment="Center" TextAlignment="Center" Foreground="White" Opacity="1" FontFamily="Arial">
            </TextBlock>
            <TextBlock x:Name="ThursdayTextBlock" Grid.Column="4" Grid.Row="0" FontSize="19" HorizontalAlignment="Center" TextAlignment="Center" Foreground="White" Opacity="1" FontFamily="Arial">
            </TextBlock>
            <TextBlock x:Name="FridayTextBlock" Grid.Column="5" Grid.Row="0" FontSize="19" HorizontalAlignment="Center" TextAlignment="Center" Foreground="White" Opacity="1" FontFamily="Arial">
            </TextBlock>
            <TextBlock x:Name="SaturdayTextBlock" Grid.Column="6" Grid.Row="0" FontSize="19" HorizontalAlignment="Center" TextAlignment="Center" Foreground="White" Opacity="1" FontFamily="Arial">
            </TextBlock>
            <TextBlock x:Name="SundayTextBlock" Grid.Column="7" Grid.Row="0" FontSize="19" HorizontalAlignment="Center" TextAlignment="Center" Foreground="White" Opacity="1" FontFamily="Arial">
            </TextBlock>

            <!--<Line Grid.Row="0" Stroke="White" StrokeThickness="1" Grid.Column="0" Grid.ColumnSpan="8" X1="0" X2="480" Y1="50" Y2="50"></Line>
            <Line Grid.Row="0" Stroke="White" StrokeThickness="1" Grid.Column="0" Grid.RowSpan="12" X1="50" X2="50" Y1="0" Y2="730"></Line>-->

            <Grid Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="8" Width="480" Grid.RowSpan="11">
                <phone:Pivot x:Name="MyPivot" SelectionChanged="ChangeWeekView_SelectionChanged" FlowDirection="LeftToRight">
                    <phone:PivotItem Margin="0,-10,0,0">
                        <ScrollViewer x:Name="CourseScrollViewer0" VerticalScrollBarVisibility="Hidden" />
                    </phone:PivotItem>
                    <phone:PivotItem Margin="0,-10,0,0">
                        <ScrollViewer x:Name="CourseScrollViewer1" VerticalScrollBarVisibility="Hidden"/>
                    </phone:PivotItem>
                    <phone:PivotItem Margin="0,-10,0,0">
                        <ScrollViewer x:Name="CourseScrollViewer2" VerticalScrollBarVisibility="Hidden"/>
                    </phone:PivotItem>
                </phone:Pivot>


            </Grid>


            <!--<ScrollViewer x:Name="CourseScrollViewer" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="8" Width="480" Grid.RowSpan="11" VerticalScrollBarVisibility="Hidden" Loaded="ScrollView_Loaded">
                -->
            <!--<Grid x:Name="CourseGrid" Opacity="1" Loaded="CourseLoadedComplete">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="50"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="64.28"/>
                        <RowDefinition Height="64.28"/>
                        <RowDefinition Height="64.28"/>
                        <RowDefinition Height="64.28"/>
                        <RowDefinition Height="64.28"/>
                        <RowDefinition Height="64.28"/>
                        <RowDefinition Height="64.28"/>
                        <RowDefinition Height="64.28"/>
                        <RowDefinition Height="64.28"/>
                        <RowDefinition Height="64.28"/>
                        <RowDefinition Height="64.28"/>
                        <RowDefinition Height="58"/>
                    </Grid.RowDefinitions>

                    <TextBlock Text="1" Grid.Row="0" FontSize="20" Foreground="White" TextAlignment="Center" VerticalAlignment="Center" Grid.Column="0" FontFamily="Microsoft YaHei"></TextBlock>
                    <TextBlock Text="2" Grid.Row="1" FontSize="20" Foreground="White" TextAlignment="Center" VerticalAlignment="Center" Grid.Column="0" FontFamily="Microsoft YaHei"></TextBlock>
                    <TextBlock Text="3" Grid.Row="2" FontSize="20" Foreground="White" TextAlignment="Center" VerticalAlignment="Center" Grid.Column="0" FontFamily="Microsoft YaHei"></TextBlock>
                    <TextBlock Text="4" Grid.Row="3" FontSize="20" Foreground="White" TextAlignment="Center" VerticalAlignment="Center" Grid.Column="0" FontFamily="Microsoft YaHei"></TextBlock>
                    <TextBlock Text="5" Grid.Row="4" FontSize="20" Foreground="White" TextAlignment="Center" VerticalAlignment="Center" Grid.Column="0" FontFamily="Microsoft YaHei"></TextBlock>
                    <TextBlock Text="6" Grid.Row="5" FontSize="20" Foreground="White" TextAlignment="Center" VerticalAlignment="Center" Grid.Column="0" FontFamily="Microsoft YaHei"></TextBlock>
                    <TextBlock Text="7" Grid.Row="6" FontSize="20" Foreground="White" TextAlignment="Center" VerticalAlignment="Center" Grid.Column="0" FontFamily="Microsoft YaHei"></TextBlock>
                    <TextBlock Text="8" Grid.Row="7" FontSize="20" Foreground="White" TextAlignment="Center" VerticalAlignment="Center" Grid.Column="0" FontFamily="Microsoft YaHei"></TextBlock>
                    <TextBlock Text="9" Grid.Row="8" FontSize="20" Foreground="White" TextAlignment="Center" VerticalAlignment="Center" Grid.Column="0" FontFamily="Microsoft YaHei"></TextBlock>
                    <TextBlock Text="10" Grid.Row="9" FontSize="20" Foreground="White" TextAlignment="Center" VerticalAlignment="Center" Grid.Column="0" FontFamily="Microsoft YaHei"></TextBlock>
                    <TextBlock Text="11" Grid.Row="10" FontSize="20" Foreground="White" TextAlignment="Center" VerticalAlignment="Center" Grid.Column="0" FontFamily="Microsoft YaHei"></TextBlock>

                </Grid>-->
            <!--
            </ScrollViewer>-->
        </Grid>

        <Canvas x:Name="DetailCanvas" Background="#DDFDFBFB" Visibility="Collapsed">

            <Grid Grid.Background="White" Opacity="0.3" Height="800" Width="480">
                <Button Opacity="0" Click="ClosePopup_Click"></Button>
            </Grid>

            <Grid Width="300" Height="180" Margin="90,310,0,0" x:Name="DetailofCourseGrid">
                <TextBlock x:Name="CourseNameTextBlock" IsHitTestVisible="False" Text="" Foreground="White" TextAlignment="Center" FontSize="30" Margin="0,10,0,0"></TextBlock>
                <TextBlock Text="教室：" IsHitTestVisible="False" Foreground="White" TextAlignment="Left" Height="30" VerticalAlignment="Top" Margin="80,50,0,0" FontSize="23"></TextBlock>
                <TextBlock Text="教师：" IsHitTestVisible="False" Foreground="White" TextAlignment="Left" Height="30" VerticalAlignment="Top" FontSize="23" Margin="80,80,0,0"></TextBlock>
                <TextBlock Text="学时：" IsHitTestVisible="False" Foreground="White" TextAlignment="Left" Height="30" VerticalAlignment="Top" FontSize="23" Margin="80,110,0,0"></TextBlock>
                <TextBlock Text="学分：" IsHitTestVisible="False" Foreground="White" TextAlignment="Left" Height="30" VerticalAlignment="Top" FontSize="23" Margin="80,140,0,0"></TextBlock>
                <TextBlock x:Name="ClassroomTextBlock" IsHitTestVisible="False" Text="" Foreground="White" TextAlignment="Center" Height="30" VerticalAlignment="Top" Margin="130,50,0,0" FontSize="23" Width="100" HorizontalAlignment="Left"></TextBlock>
                <TextBlock x:Name="TeacherNameTextBlock" IsHitTestVisible="False" Text="" Foreground="White" TextAlignment="Center" Height="30" VerticalAlignment="Top" FontSize="23" Margin="130,80,0,0" Width="100" HorizontalAlignment="Left"></TextBlock>
                <TextBlock x:Name="ClassHoursTextBlock" IsHitTestVisible="False" Text="" Foreground="White" TextAlignment="Center" Height="30" VerticalAlignment="Top" FontSize="23" Margin="130,110,0,0" Width="100" HorizontalAlignment="Left"></TextBlock>
                <TextBlock x:Name="CreditsTextBlock" IsHitTestVisible="False" Text="" Foreground="White" TextAlignment="Center" Height="30" VerticalAlignment="Top" FontSize="23" Margin="130,140,0,0" Width="100" HorizontalAlignment="Left"></TextBlock>
                <Button Opacity="0" Click="ClosePopup_Click"></Button>
            </Grid>
        </Canvas>
        <Canvas x:Name="LeadingInCanvas" Height="60" Visibility="Collapsed">
            <Grid Height="60" Width="240" Margin="120,0,0,0" Background="#99FFFFFF" Opacity="0.8">
                <TextBlock Text="点我导入课表" FontSize="30" Foreground="White" TextAlignment="Center" VerticalAlignment="Center">
                </TextBlock>
                <Button x:Name="LeadingInButton" Opacity="0" Height="100" Click="LeadingIn_Click"></Button>
            </Grid>
        </Canvas>

        <Canvas x:Name="PasswordCanvas" Height="240" Visibility="Collapsed" Margin="0,240,0,0" VerticalAlignment="Top">
            <Grid Width="480" Height="200" Background="DarkSeaGreen" >
                <StackPanel Margin="50,10,50,0">
                    <TextBlock Text="请输入新教务处密码"
                               Foreground="White"
                               FontSize="30" 
                               TextAlignment="Center"
                               />
                    <TextBox x:Name="PasswordTextBox" CaretBrush="Black" Background="White" InputScope="Password"></TextBox>
                    <Button Content="确定" Background="DarkSeaGreen" Foreground="White" Click="ConfirmButton_CLick"/>
                </StackPanel>
            </Grid>
        </Canvas>

        <Grid.Resources>
            <Storyboard x:Name="LoadedCompleteStoryboard">
                <DoubleAnimation Storyboard.TargetName="CourseGrid"
                                 Storyboard.TargetProperty="Opacity"
                                 From="0"
                                 To="1"
                                 Duration="0:0:1"
                                 ></DoubleAnimation>
            </Storyboard>
        </Grid.Resources>
    </Grid>

</phone:PhoneApplicationPage>